package com.xueyi.aixihu.controller;

import com.xueyi.aixihu.controller.base.BaseController;
import com.xueyi.aixihu.entity.vo.AreaReportAuditStateInfoVo;
import com.xueyi.aixihu.entity.vo.AxhAuditFinanceLogVo;
import com.xueyi.aixihu.entity.vo.ReportTotalNumberVo;
import com.xueyi.aixihu.entity.vo.SelectAreaReportAuditReq;
import com.xueyi.aixihu.reqeust.FinanceReportReq;
import com.xueyi.aixihu.response.base.BaseResponse;
import com.xueyi.aixihu.service.DataCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 描述 数据中心请求接口控制器
 *
 * @author 刘梓江
 * @date 2023-12-12 12:12
 */
@RestController
public class DataCenterController extends BaseController {

    @Autowired
    private DataCenterService dataCenterService;

    /**
     * 获取报表总数量
     * @return
     */
    @RequestMapping("/dataCenter/statisticsReportTotalNumber")
    public BaseResponse<ReportTotalNumberVo> statisticsReportTotalNumber(){
        ReportTotalNumberVo reportTotalNumberVo = dataCenterService.statisticsReportTotalNumber();
        return BaseResponse.success(reportTotalNumberVo);
    }


    /**
     * 查询区域报表审核列表信息
     * @return
     */
    @RequestMapping("/dataCenter/selectAreaReportAuditInfoList")
    public BaseResponse<AreaReportAuditStateInfoVo> selectAreaReportAuditInfoList(@Validated SelectAreaReportAuditReq reportAuditReq){
        AreaReportAuditStateInfoVo areaReportAuditStateInfoVo = dataCenterService.selectAreaReportAuditInfoList(reportAuditReq);
        return BaseResponse.success(areaReportAuditStateInfoVo);
    }

    /**
     * 查询用户操作报表日志
     *
     * @param reportReq
     * @return
     */
    @RequestMapping("/dataCenter/selectUserOperationReportLogList")
    BaseResponse<List<AxhAuditFinanceLogVo>> selectUserOperationReportLogList(FinanceReportReq reportReq){
        List<AxhAuditFinanceLogVo> axhAuditFinanceLogVos = dataCenterService.selectUserOperationReportLogList(reportReq);
        return BaseResponse.success(axhAuditFinanceLogVos);
    }

}
